package com.iva.model;

// Generated 11-03-2013 09:07:49 PM by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TbGrado generated by hbm2java
 */
@Entity
@Table(name = "tb_grado", catalog = "new_escool")
public class TbGrado implements java.io.Serializable {

	private Integer idGrado;
	private TbNivel tbNivel;
	private String nombreGrado;
	private Set<TbSeccion> tbSeccions = new HashSet<TbSeccion>(0);

	public TbGrado() {
	}

	public TbGrado(TbNivel tbNivel) {
		this.tbNivel = tbNivel;
	}

	public TbGrado(TbNivel tbNivel, String nombreGrado,
			Set<TbSeccion> tbSeccions) {
		this.tbNivel = tbNivel;
		this.nombreGrado = nombreGrado;
		this.tbSeccions = tbSeccions;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id_grado", unique = true, nullable = false)
	public Integer getIdGrado() {
		return this.idGrado;
	}

	public void setIdGrado(Integer idGrado) {
		this.idGrado = idGrado;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "tb_nivel_id_nivel", nullable = false)
	public TbNivel getTbNivel() {
		return this.tbNivel;
	}

	public void setTbNivel(TbNivel tbNivel) {
		this.tbNivel = tbNivel;
	}

	@Column(name = "nombre_grado", length = 45)
	public String getNombreGrado() {
		return this.nombreGrado;
	}

	public void setNombreGrado(String nombreGrado) {
		this.nombreGrado = nombreGrado;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "tbGrado")
	public Set<TbSeccion> getTbSeccions() {
		return this.tbSeccions;
	}

	public void setTbSeccions(Set<TbSeccion> tbSeccions) {
		this.tbSeccions = tbSeccions;
	}

}
